package string;

public class StringDemo {
    public static void main(String[] args) {
        String s1="112eee";
        String s2="112eee";
        String s3="112eee";
        String s4=new String("112eee");
        System.out.println(s1==s2);
        System.out.println(s1==s3);
        System.out.println(s1==s4);
        String s5="112eee";
        System.out.println(s3==s5);
        System.out.println("-----------------------");
        String s="112";
        String s6=s+"eee";
        System.out.println(s6==s1);
        String s7="112"+"eee";
        System.out.println(s7==s1);
        String s8="112eee";
        String s9=new String("112eee");
        System.out.println(s8==s9);//错==比的是地址
        System.out.println(s8.equals(s9));//对  .equals()比的是内容
            }

}
